import store from 'store';
export default {
	state: {
		token: store.get('token') || '',
		userInfo: {},
	},
	mutations: {
		setToken(state, payload) {
			state.token = payload;
			store.set('token', payload);
		},
		setUserInfo(state, payload) {
			state.userInfo = payload;
			store.set('userInfo', payload);
		},
	},
	actions: {
		// 获取用户信息
		async getUserInfo({ commit }) {
			const userInfo = {};
			commit('setUserInfo', userInfo);
		},
	}
};
